<template>
    <div class="ej_nav_box">
        <div class="erji_left_nav">
            <div class="zdgk_fl">
                <div class="zdgk_fl_titel">
                    高级搜索
                </div>
                <el-form ref="form" :model="formdata" label-width="80px">
                    <div class="zdgk_fl_nr">
                        <div class="zdgk_fl_nr_li">
                            <div class="zdgk_fl_nrfl">所属类别:</div>
                            <div class="zdgk_fl_nrfr">
                                <el-select clearable style="width:100%" v-model="formdata.columnId" placeholder="请选择">
                                    <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
                                    </el-option>
                                </el-select>
                            </div>
                        </div>

                        <div class="zdgk_fl_nr_li">
                            <div class="zdgk_fl_nrfl">所属单位:</div>
                            <div class="zdgk_fl_nrfr">
                                <el-select clearable style="width:100%" v-model="formdata.organization" placeholder="请选择">
                                    <el-option v-for="item in options2" :key="item.value" :label="item.label" :value="item.value">
                                    </el-option>
                                </el-select>
                            </div>
                        </div>

                        <div class="zdgk_fl_nr_li">
                            <div class="zdgk_fl_nrfl">审&nbsp;核 &nbsp;人:</div>
                            <div class="zdgk_fl_nrfr">
                                <el-input clearable v-model="formdata.postedBy"></el-input>
                            </div>
                        </div>
                        <div class="zdgk_fl_nr_li">
                            <div class="zdgk_fl_nrfl">作 &nbsp;&nbsp;者:</div>
                            <div class="zdgk_fl_nrfr">
                                <el-input clearable v-model="formdata.author"></el-input>
                            </div>
                        </div>
                        <div class="zdgk_fl_nr_li">
                            <div class="zdgk_fl_nrfl">文章标题:</div>
                            <div class="zdgk_fl_nrfr">
                                <el-input clearable v-model="formdata.title"></el-input>
                            </div>
                        </div>
                        <div class="zdgk_fl_nr_li">
                            <div class="zdgk_fl_nrfl">文章内容:</div>
                            <div class="zdgk_fl_nrfr">
                                <el-input clearable v-model="formdata.content"></el-input>
                            </div>
                        </div>

                        <div class="zdgk_fl_nr_li">
                            <div class="zdgk_fl_nrfl">起始时间:</div>
                            <div class="zdgk_fl_nrfr">
                                <el-date-picker clearable style="width:100%" v-model="formdata.beginTime"
                                    value-format="yyyy-MM-dd HH:ss:mm" format="yyyy-MM-dd HH:ss:mm" type="date"
                                    placeholder="选择日期">
                                </el-date-picker>
                                <!-- <el-input v-model=""></el-input> -->
                            </div>
                        </div>
                        <div class="zdgk_fl_nr_li">
                            <div class="zdgk_fl_nrfl">终止时间:</div>
                            <div class="zdgk_fl_nrfr">
                                <el-date-picker clearable style="width:100%" v-model="formdata.endTime"
                                    value-format="yyyy-MM-dd HH:ss:mm" format="yyyy-MM-dd HH:ss:mm" type="date"
                                    placeholder="选择日期">
                                </el-date-picker>
                                <!-- <el-input v-model="formdata.endTime"></el-input> -->
                            </div>
                        </div>

                        <div class="zdgk_fl_nr_liss">
                            <el-button @click="search">搜&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;索</el-button>
                        </div>
                    </div>
                </el-form>
            </div>

        </div>


    </div>
</template>
<script>
import { columnAdd, columnqueryAll, columndelete, contentApiqueryPage, contentApidelete, approval } from "@/api/webpage";
import { organizationApiqueryAll } from "@/api/organizationApir";
export default {
    name: "SeniorSearch",
    props: {
        formdata: {
            type: Object,
            default: function () {
                return {};
            },
        }
    },
    data() {
        return {
            options: [],
            options2: [],

        };
    },
    created() {
        this.getoptions()
    },
    methods: {
        search() {
            this.formdata.pageNum = 1
            this.formdata.pageSize = 10
            this.$emit('search', this.formdata)
        },
        getoptions() {
            let data = {
                name: "",
                code: "",
                parentId: '',
                showQuery: '1'
            };
            columnqueryAll(data).then((res) => {
              console.log("所属类别",res.data);
                if (res.code == 0) {
                    res.data = res.data.filter(item => { return item.columnName != '审核管理'})
                    this.options = res.data.map(item => {
                        return { label: item.name, value: item.id }
                    });
                }
            });
            let params = {
                name: '',
                parentId: '',
            }
            organizationApiqueryAll(params).then((res) => {
                if (res.code == 0) {
                    this.options2 = res.data.map(item => {
                        return { label: item.name, value: item.id }
                    });
                }
            });
        },
    },
};
</script>
<style scoped>
@import "../assets/css/font/iconfont.css";
@import "../assets/css/index.css";
@import "../assets/css/style.css";
.zdgk_fl_nr_liss .el-button {
    width: 100%;
    height: 38px;
    background: #047adb;
    padding: 0;
}

/* .zdgk_fl_nrfr .el-input--suffix .el-input__inner{
        padding: 0 !important;
    } */

</style>
